<?php

namespace App\Model\Admin;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Model\Admin\SystemModel
 *
 * @property int $id
 * @property string $name 模型名称
 * @property string $table_name 数据库表名
 * @property string $description 描述
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereDescription($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereTableName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property int $menu_id 关联菜单
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Model\Admin\ModelFieldModel[] $fields
 * @property-read int|null $fields_count
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\Admin\SystemModel whereMenuId($value)
 */
class SystemModel extends Model
{
    //
    protected $table = 'model';

    public function fields()
    {
        return $this->hasMany('App\Model\Admin\ModelFieldModel','model_id');
    }
}
